<template>
  <div class="top-bar">
    <ul>
      <li class="left" v-for="(va,ka) in listLeft">
        <router-link :to="va.link" v-text="va.name"></router-link>
      </li>
      <li class="right"  v-for="(va,ka) in listRight">
        <router-link :to="va.link" v-text="va.name"></router-link>
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    name: 'TopBar',
    data () {
      return {
        listLeft: [{link: '/', name: '首页'}, {link: '/hi', name: 'Hi'}],
        listRight: [{link: '/hi/hi1', name: 'H1'}, {link: '/hi/hi2', name: 'H2'}]
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  h1, h2 {
    font-weight: normal;
  }

  ul {
    list-style-type: none;
    padding: 0;
  }
  ul:after{
    content: '';
    display: block;
    clear : both;
  }

  li {
    display: inline-block;
    margin: 0 10px;
  }

  .left{
    float: left;
  }

  .right{
    float: right;
  }

  a {
    color: #42b983;
  }

</style>
